
import ui.*;
import map.*;
import mob.*;

class IronAge {

  //static Creature player = new Creature((char) 65312, 200, 0, 0);
  //static Creature player = new Creature('@', 200, 0, 0);
  static Creature player = new Creature((char) 0x2580, 200, 0, 0);

  public static void main(String[] args) {

    Input i = new Input();
    Screen s = new Screen(i);
    Map m = new Map(s);

    m.placePlayer(player, 22, 6);
    m.display();

    s.addMessage("The goblin wretch smacks you with his gnarled club.");
    s.addMessage("You slice the goblin wretch with your short sword.");
    s.addMessage("Your skill in blades has increased the 3!");
    s.addMessage("You have advanced to level 2!");
    s.addMessage("You kill the goblin wretch!");

    s.repaint();

    while(true) {
      int c = i.getInput();
      if(c == Input.CMD_N) m.moveCreature(player, 0, -1);
      if(c == Input.CMD_NE) m.moveCreature(player, 1, -1);
      if(c == Input.CMD_E) m.moveCreature(player, 1, 0);
      if(c == Input.CMD_SE) m.moveCreature(player, 1, 1);
      if(c == Input.CMD_S) m.moveCreature(player, 0, 1);
      if(c == Input.CMD_SW) m.moveCreature(player, -1, 1);
      if(c == Input.CMD_W) m.moveCreature(player, -1, 0);
      if(c == Input.CMD_NW) m.moveCreature(player, -1, -1);
      m.display();
      s.repaint();
    }

  }

}
